<?php
class TopicModel extends Model{

	private $_tablename = "topic";

	public function __construct(){}

	public function getTopicById( $tid ){
		$sql = "SELECT * FROM ".$this->_tablename." WHERE tid = ?";
		parent::getDb()->_db->query( $sql, array( intval($tid) ) );
		return parent::getDb()->_db->fetch();
	}

	/**
	 * insert database;
	 * @params options
	 * return int 1/0
	 */
	public function create( $options ){
		return parent::insert( $this->_tablename, $options );
	}

	/**
	 * mulit-insert database;
	 * @params tablename
	 * @params options
	 * @params multi col
	 * return int 1/0
	 */
	public function multi_create( $options ){
		return parent::multi_insert( $this->_tablename, $options);
	}
}
